<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <jsp:include page="../common/header.jsp" />
    <script type="text/javascript">
        function delBtn() {
            var $delBtn = $("input[name=delBtn]");
            $delBtn.bind("click", function () {
                if (window.confirm("确定删除这些班级信息吗，将会一并删除关联这些班级的所有学生的成绩记录以及所有的教学安排？")) {
                    $("#myForm").submit();
                }
                else {
                }
                ;
            });
        }

        $(function () {
            delBtn();

        });
    </script>
    <jsp:include page="../common/mycss.jsp" />
</head>

<body>
<div class="lyear-layout-web">
    <div class="lyear-layout-container">
        <!--左侧导航-->
        <aside class="lyear-layout-sidebar">
            <!-- logo -->
            <div id="logo" class="sidebar-header">
                <jsp:include page="../common/title.jsp" />
            </div>
            <div class="lyear-layout-sidebar-scroll">
                <jsp:include page="../common/menu.jsp" />
            </div>
        </aside>
        <!--End 左侧导航-->
        <jsp:include page="../common/top.jsp" />
        <!--页面主要内容-->
        <main class="lyear-layout-content">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="card">
                            <div class="card-toolbar clearfix">
                                <h5>班级管理&nbsp;&gt;&nbsp;班级信息删除</h5>
                            </div>
                            <div class="card-body">
                                <div id="accordion">
                                    <div>
                                        <form action="gradeDelete.action" method="post" id="myForm">
                                            <table class="datalist">
                                                <tr>
                                                    <th>班级编号</th>
                                                    <th>班级名称</th>
                                                    <th>班主任编号</th>
                                                    <th>班主任姓名</th>
                                                    <th>学生人数</th>
                                                    <th>操作</th>
                                                </tr>
                                                <s:iterator value="gradeInfos">
                                                    <tr>
                                                        <td><s:property value="gradeID"/></td>
                                                        <td><s:property value="year"/>届<s:property value="name"/>（<s:property value="classID"/>）班</td>
                                                        <td><s:property value="adviserID"/></td>
                                                        <td><s:property value="adviserName"/></td>
                                                        <td><s:property value="stuCount"/></td>
                                                        <s:if test="stuCount == 0">
                                                            <td><input type="checkbox" name="gradeDel" value='<s:property value="gradeID" />'/></td>
                                                        </s:if>
                                                        <s:else>
                                                            <td>&nbsp;</td>
                                                        </s:else>
                                                    </tr>
                                                </s:iterator>
                                                <tr>
                                                    <td colspan="5"></td>
                                                    <td><input type="button" name="delBtn" value="删除"/></td>
                                                </tr>
                                            </table>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>

            </div>

        </main>
        <!--End 页面主要内容-->
    </div>
</div>
</body>
</html>
